#pragma once

#include "Binding/BoundExpression.hpp"
#include "Binding/BoundStatement.hpp"

class BoundIfStatement : public BoundStatement
{
public:
    SharedBoundExpression Condition;
    SharedBoundStatement  ThenStatement;
    SharedBoundStatement  ElseStatement;

public:
    BoundIfStatement(SharedBoundExpression condition, SharedBoundStatement thenStatement, SharedBoundStatement elseStatement)
        : BoundStatement(BoundNodeKind::IfStatement), Condition(condition), ThenStatement(thenStatement), ElseStatement(elseStatement)
    {
    }
    ~BoundIfStatement() = default;

public:
    virtual std::vector<SharedBoundNode> GetChildren() override
    {
        if (this->ElseStatement != nullptr)
            return {this->Condition, this->ThenStatement, this->ElseStatement};
        return {this->Condition, this->ThenStatement};
    }
};
